import { config } from '../../config/index';

/** 获取购物车mock数据 */
function mockFetchCartGroupData(params) {
  const { delay } = require('../_utils/delay');
  const { genCartGroupData,resp } = require('../../model/cart');
  return delay().then(() => resp);
}

/** 获取购物车数据 */
export function fetchCartGroupData(params) {
  // if (config.useMock) {
  //   return mockFetchCartGroupData(params);
  // }

  // return new Promise((resolve) => {
  //   resolve('real api');
  // });
  return mockFetchCartGroupData(params)
}
export function addCartData(cartItem){
  const {resp} = require('../../model/cart')
  resp.data.storeGoods[0].promotionGoodsList[0].goodsPromotionList.push(cartItem)
}
